package com.zhiyou100.action;

import com.zhiyou100.entity.Attendance;
import com.zhiyou100.entity.ResponseVO;
import com.zhiyou100.service.AttendanceService;
import com.zhiyou100.service.StudentVOService;
import com.zhiyou100.vo.StudentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/studentVO")
public class StudentVOController {
    @Autowired
    private StudentVOService StudentVOService;

    @ResponseBody
    @GetMapping("/getOneByGid/{gid}")
    public ResponseVO<List<StudentVO>>  getOneMethod(@PathVariable("gid") Integer gid){
        return new ResponseVO<>(200,"获取成功！",StudentVOService.getAllByGrade(gid));
    }
}